import React from 'react'
import { decorator, Source, ISourceChildProps } from 'grey-react-box';
import { Button } from 'antd';
import { FormComponentProps } from 'antd/lib/form';
import { RouteChildrenProps } from 'react-router';
import Ms from './Demo.box';

interface DemoProps {
    onC?: number;
}

interface DemoPropsIn extends FormComponentProps, RouteChildrenProps, DemoProps, ISourceChildProps<Ms> {
}

export default decorator<DemoProps, DemoPropsIn>(
    Source.connect(),
)(
    props => {

        // const [c, setC] = React.useState(0);

        const a = props.controller.useMemo(e => e.a, []);

        return (
            <div>
                box2:{a}
                <Button onClick={() => { props.controller.add() }} >增加</Button>
            </div>
        )
    }
)





